<?php
class traceorderModel extends model {
	
	public function __construct(){
		parent::__construct();
	}
	
	public function findPage($page, $condition, $field=null){
//		return parent::findPage($page, $condition, $field);
	}
	
	public function add($rec){
//		return parent::insert($rec);
		$this->dao->insert('traceorder')->data($rec)->exec();
		return $this->dao->lastInsertID();
	}
	
	public function get($id, $field='*'){
		$id = (int) $id;		
//		return parent::findUnique(array('id'=>$id),null,$field);
	}
	
	public function search($ordcode){
		$data = $this->dao->select('*')->from('traceorder')->where('ordcode')->eq($ordcode)->orderBy('tracetime desc')->fetchAll();
        return $data;
	}
	
	public function findAll(){
		$data = $this->dao->select('*')->from('traceorder')->orderBy('tracetime desc')->fetchAll();
		return $data;
		
	}
	
	
	
	
}
